package cn.argentoaskia.crm.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class  EmployeeWithDeptName {
    private Integer id;
    private String name;
    private String gender;

    // 处理日期，为了防止映射不上数据，一般都要加上这两个注解
    // 两个注解特别重要的,专门用来处理日期的读写
    // 前端-->后端： @DateTimeFormat
    // 当然前端传递数据给我们的控制器，控制器在传递业务层的时候，通过这个注解格式化时间
    // 后端-->前端：@JsonFormat
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "UTC")
    private Date birthday;
    private String idCard;
    private String email;
    private String phone;
    private String department;
    private String workState;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "UTC")
    private Date beginDate;

    @Override
    public String toString() {
        final StringBuffer sb = new StringBuffer("EmployeeWithDeptName{");
        sb.append("id=").append(id);
        sb.append(", name='").append(name).append('\'');
        sb.append(", gender='").append(gender).append('\'');
        sb.append(", birthday=").append(birthday);
        sb.append(", idCard='").append(idCard).append('\'');
        sb.append(", email='").append(email).append('\'');
        sb.append(", phone='").append(phone).append('\'');
        sb.append(", department='").append(department).append('\'');
        sb.append(", workState='").append(workState).append('\'');
        sb.append(", beginDate=").append(beginDate);
        sb.append('}');
        return sb.toString();
    }

    public Integer getId() {
        return id;
    }

    public EmployeeWithDeptName setId(Integer id) {
        this.id = id;
        return this;
    }

    public String getName() {
        return name;
    }

    public EmployeeWithDeptName setName(String name) {
        this.name = name;
        return this;
    }

    public String getGender() {
        return gender;
    }

    public EmployeeWithDeptName setGender(String gender) {
        this.gender = gender;
        return this;
    }

    public Date getBirthday() {
        return birthday;
    }

    public EmployeeWithDeptName setBirthday(Date birthday) {
        this.birthday = birthday;
        return this;
    }

    public String getIdCard() {
        return idCard;
    }

    public EmployeeWithDeptName setIdCard(String idCard) {
        this.idCard = idCard;
        return this;
    }

    public String getEmail() {
        return email;
    }

    public EmployeeWithDeptName setEmail(String email) {
        this.email = email;
        return this;
    }

    public String getPhone() {
        return phone;
    }

    public EmployeeWithDeptName setPhone(String phone) {
        this.phone = phone;
        return this;
    }

    public String getDepartment() {
        return department;
    }

    public EmployeeWithDeptName setDepartment(String department) {
        this.department = department;
        return this;
    }

    public String getWorkState() {
        return workState;
    }

    public EmployeeWithDeptName setWorkState(String workState) {
        this.workState = workState;
        return this;
    }

    public Date getBeginDate() {
        return beginDate;
    }

    public EmployeeWithDeptName setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
        return this;
    }
}
